#ifndef SysCpu_h__
#define SysCpu_h__

namespace inf {

	enum cpuid_t {
		CPUID_UNKNOWN = 0x00000,
		CPUID_INTEL = 0x000001,
		CPUID_AMD = 0x000002,

		CPUID_MMX							= 0x00010,
		CPUID_MMX_EXTENSION					= 0x00020,
		CPUID_3DNOW							= 0x00040,
		CPUID_3DNOW_EXTENSION				= 0x00080,
		CPUID_SSE							= 0x00100,
		CPUID_SSE2							= 0x00200,
		CPUID_SSE3							= 0x00400,
		CPUID_SSE3_SUPPLEMENTAL				= 0x00800,
		CPUID_SSE4							= 0x01000,
		CPUID_SSE4A							= 0x02000,
		CPUID_SSE4_1						= 0x04000,
		CPUID_SSE4_2						= 0x08000,

		CPUID_HTT							= 0x10000,
		CPUID_CMOV							= 0x20000,	//!< Conditional Move (CMOV) and fast floating point comparison (FCOMI) instructions
		CPUID_EM64T							= 0X40000
	};

	struct cpuInfo_t {
		int logicalNum;				    //!< logical number of CPUs
		int physicalNum;			    //!< physical number of CPUs
		bool withHyperThreads;
	};

	struct SysCpu {
		static void				init();

		// ================================================================================================
		//! get Processor Identify, as a cpuid_t
		//! @return cpuid_t value
		//! @see  cpuid_t
		// ================================================================================================
		static unsigned int		get_processor_id();

		// ================================================================================================
		//! get cpuInfo_t
		//! @param info output of the function
		//! @see  cpuInfo_t
		// ================================================================================================
		static void				get_cpuInfo( cpuInfo_t& info );

		// ================================================================================================
		//! get Processor String
		//! @return the string on processor (contain Vendor\Manfacture\...)
		// ================================================================================================
		static const char *		get_processor_string();

		// ================================================================================================
		//! get clock-tricks per second on CPU
		//! @return the core frequency, unit is MHZ.
		// ================================================================================================
		static double			get_clock_ticks_per_second();
		//! @}
	};


}   // ::inf

#endif // SysCpu_h__